package com.xy.farm.activity.farm;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.amap.api.maps2d.AMap;
import com.amap.api.maps2d.MapView;
import com.xy.farm.R;
import com.xy.farm.activity.base.BaseActivity;
import com.xy.farm.activity.farm.adapter.SelectFarmAdapter;

public class SelectFarmActivity extends BaseActivity
{
    private AMap aMap;
    private MapView mapView;
    private RecyclerView recyclerView;
    private SelectFarmAdapter adapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select_farm);
        setTitle("选择农场");
        findViewById(R.id.btn_back).setOnClickListener(this);
        recyclerView = findViewById(R.id.recyclerView);
        recyclerView.setHasFixedSize(true);
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter((adapter = new SelectFarmAdapter()));
        mapView = findViewById(R.id.mapView);
        mapView.onCreate(savedInstanceState);
        aMap = mapView.getMap();
        aMap.getUiSettings().setZoomControlsEnabled(false);

    }
}
